/*
 * @Author: your name
 * @Date: 2022-04-21 22:15:18
 * @LastEditTime: 2022-07-25 11:11:56
 * @LastEditors: YNT 2501512800@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \22-03-19 智慧社区\api\topic.js
 */
import wxRequest from '../utils/wx-request'

class SpecialModel extends wxRequest {
  // 话题列表
  topicList(params) {
    return this.request({
      url: `/api/v1/invitation/type/list`,
      method: 'GET',
      params,
    })
  }

  // 话题详情
  topicDetail(id) {
    return this.request({
      url: `/api/v1/invitation/type?invitation_type_id=${id}`,
    })
  }

  // 话题活动列表
  actTopicList(id, params) {
    return this.request({
      url: `/api/v1/invitation/list?invitation_type_id=${id}`,
      method: 'GET',
      params,
    })
  }

  // 话题帖子详情
  topicArticleDetail(id) {
    return this.request({
      url: `/api/v1/invitation?id=${id}`,
    })
  }

  // 话题帖子发布
  publishTopic(params) {
    return this.request({
      url: `/api/v1/invitation`,
      method: 'POST',
      params,
    })
  }

  // 帖子评论
  debate(data) {
    return this.request({
      url: `/api/v1/invitation/comment`,
      method: 'POST',
      data,
    })
  }

  // 帖子点赞
  like(data) {
    return this.request({
      url: `/api/v1/invitation/comment/like`,
      method: 'GET',
      data,
    })
  }
}

export default new SpecialModel()
